home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Games / Game Sample Code / ZAM 1.0a13 / GameHeaders / xthing.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-16  |  1.2 KB  |  39 lines  |  [TEXT/KAHL]

  1. #pragma once
  2. #include <Timer.h>
  3.  
  4. #define TaskActiveFlag 0x8000
  5.  
  6. typedef    struct xQHdr {        
  7.     long            qFlags;
  8.     struct xthing    *qHead;
  9.     struct xthing    *qTail;
  10.     short            qEntries;
  11. } xQHdr;
  12.  
  13. typedef Boolean (*updateProc)(struct xthing *xtp, long dataRef);
  14.  
  15. typedef struct xthing {
  16.     TMTask            timer;            /* update time */
  17.     struct xthing    *next;            /* link in xthing queue */
  18.     long            prime;            /* number of miliseconds between runs */
  19.     Boolean            taskFlag;        /* flag set when task is ready to fire */
  20.     Boolean            waiting;        /* true if put in list with a task launched */
  21.     Boolean            inList;            /* set after task is first added */
  22.     long            dataRef;        /* handy place to put your gum */
  23.     long            interval;        /* the interval between runs */
  24.     updateProc        actionProc;        /* pointer to task service routine */
  25. } xthing;
  26.  
  27.  
  28. void xInitQueueHeader(xQHdr *queue);
  29. void xEnqueue(xthing *qel, xQHdr *queue);
  30. void xDequeue(xthing *qel, xQHdr *queue);
  31.  
  32. xthing *StartXThing(xthing *xtp, long prime, updateProc updtProc, long dataRef);
  33. void ProcessXThingTask(short numTasksToProcess);
  34. void InitXThingTask(void);
  35. void KillAllXThingTasks(void);
  36.  
  37. void AddXThing(xthing *xtp, long prime, updateProc updtProc, long dataRef);
  38. void EnqueueXThing(xthing *xtp);
  39.